# coding=gbk
# import data from ini file
import ConfigParser
import config

class configini():
    def initconfig(self):
        cfg = ConfigParser.RawConfigParser()
        return cfg
    
    def loadconfig(self,cfg):
        cfg.readfp(open('test.ini'))
        config.dbpath = cfg.get("MAINCONFIG","MDBPATH")
        config.closewinconfirm = cfg.get("Setting","closewinconfirm")

    def saveconfig(self,cfg,section,profile,str):
        cfg.set(section, profile, str)


if __name__ == "__main__":
    prog = configini()
    cfg=prog.initconfig()
    prog.loadconfig(cfg)
    print config.MDBPATH